//
//  MoBanElevenAllSelect.m
//  MoBan
//
//  Created by apple on 16/7/27.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "MoBanElevenAllSelect.h"
@interface MoBanElevenAllSelect()
@property(nonatomic,strong)UIButton *butten;
@end
@implementation MoBanElevenAllSelect
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addUI];
    }
    return self;
}
-(void)addUI
{
    self.butten = [[UIButton alloc]init];
    [self.butten setImage:[UIImage imageNamed:@"checknor.png"] forState:UIControlStateNormal];
    [self.butten setImage:[UIImage imageNamed:@"check.png"] forState:UIControlStateSelected];
    [self.butten addTarget:self action:@selector(buttenClic:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.butten];
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.butten.frame = CGRectMake(10*Kscr, 5*Kscr, 20*Kscr, 20*Kscr);

}
-(void)buttenClic:(UIButton *)butten;
{
    butten.selected = !butten.selected;
    
    if ([self.deleget respondsToSelector:@selector(ZBallSelect:)]) {
        [self.deleget ZBallSelect:butten];
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
